#include <ros/ros.h>
#include <tf/transform_listener.h>
#include <tf/transform_broadcaster.h>

int main(int argc, char** argv)
{
	ros::init(argc, argv, "odom_listener");
  ros::NodeHandle("~");
	
	tf::TransformListener listener;
	
  tf::StampedTransform stampedTransform;
  tf::Transform transform;

  static tf::TransformBroadcaster br;

	ros::Rate rate(10.0);

	while(ros::ok())
	{
		try
		{
			listener.lookupTransform("/odom","/base_link", ros::Time(0), stampedTransform);
			
      transform = stampedTransform.inverse();

			br.sendTransform(tf::StampedTransform(transform, ros::Time::now(), "/robot_eth/0/vicon","/odom" ));

    }
    catch(tf::TransformException ex)
    {
			ROS_ERROR("%s", ex.what());
		}
		
		ros::spinOnce();
		rate.sleep();
	}

	return 0;
}
